<template>
  <a-modal
    title="编辑商户档案"
    :width="900"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-form-item v-show="false"><a-input v-decorator="['compid']" /></a-form-item>
        <a-form-item
          label="商户名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入商户名称" v-decorator="['compname', {rules: [{required: true, message: '请输入商户名称！'}]}]" />
        </a-form-item>
        <a-form-item
          label="所在城市名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入所在城市名称" v-decorator="['areaName', {rules: [{required: true, message: '请输入所在城市名称！'}]}]" />
        </a-form-item>
        <a-form-item
          label="地址"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入地址" v-decorator="['address', {rules: [{required: true, message: '请输入地址！'}]}]" />
        </a-form-item>
        <a-form-item
          label="注册手机号"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入注册手机号" v-decorator="['mobile', {rules: [{required: true, message: '请输入注册手机号！'}]}]" />
        </a-form-item>
        <a-form-item
          label="联系人"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入联系人" v-decorator="['relation', {rules: [{required: true, message: '请输入联系人！'}]}]" />
        </a-form-item>
        <a-form-item
          label="注册日期"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-date-picker style="width: 100%" placeholder="请选择注册日期" v-decorator="['createdate',{rules: [{ required: true, message: '请选择注册日期！' }]}]" @change="createdateOnChange"/>
        </a-form-item>
        <a-form-item
          label="优汽在线店铺名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入优汽在线店铺名称" v-decorator="['storeName', {rules: [{required: true, message: '请输入优汽在线店铺名称！'}]}]" />
        </a-form-item>
        <a-form-item
          label="所在市"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入所在市" v-decorator="['cityId', {rules: [{required: true, message: '请输入所在市！'}]}]" />
        </a-form-item>
        <a-form-item
          label="所在省"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入所在省" v-decorator="['provinceId', {rules: [{required: true, message: '请输入所在省！'}]}]" />
        </a-form-item>
        <a-form-item
          label="车型"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入车型" v-decorator="['motorcycle', {rules: [{required: true, message: '请输入车型！'}]}]" />
        </a-form-item>
        <a-form-item
          label="公司名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入公司名称" v-decorator="['companyName', {rules: [{required: true, message: '请输入公司名称！'}]}]" />
        </a-form-item>
        <a-form-item
          label="营业执照电子版"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <!-- <a-input placeholder="请输入营业执照电子版" v-decorator="['businessLicensePhoto', {rules: [{required: true, message: '请输入营业执照电子版！'}]}]" />
          <img ref=""/> -->
          <img alt="请输入营业执照电子版" style="width: 50%" :src="result.businessLicensePhoto" />
        </a-form-item>
        <a-form-item
          label="公司银行账号"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入公司银行账号" v-decorator="['bankAccountNumber', {rules: [{required: true, message: '请输入公司银行账号！'}]}]" />
        </a-form-item>
        <a-form-item
          label="开户银行支行名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入开户银行支行名称" v-decorator="['bankName', {rules: [{required: true, message: '请输入开户银行支行名称！'}]}]" />
        </a-form-item>
        <a-form-item
          label="创建人 userid"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入创建人 userid" v-decorator="['createPerson', {rules: [{required: true, message: '请输入创建人 userid！'}]}]" />
        </a-form-item>
        <a-form-item
          label="更新人 userid"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入更新人 userid" v-decorator="['updatePerson', {rules: [{required: true, message: '请输入更新人 userid！'}]}]" />
        </a-form-item>
        <a-form-item
          label="是否删除"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <!-- <a-input placeholder="请输入是否删除" v-decorator="['deleted', {rules: [{required: true, message: '请输入是否删除！'}]}]" /> -->
          <a-radio-group v-decorator="['deleted', {rules: [{required: true, message: '请输入是否删除！'}]}]">
            <a-radio :value="1">
              是
            </a-radio>
            <a-radio :value="0">
              否
            </a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item
          label="主营商品"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入主营商品" v-decorator="['mainGoods', {rules: [{required: true, message: '请输入主营商品！'}]}]" />
        </a-form-item>
        <a-form-item
          label="经纬度坐标"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入经纬度坐标" v-decorator="['position', {rules: [{required: true, message: '请输入经纬度坐标！'}]}]" />
        </a-form-item>
        <a-form-item
          label="法人身份证号"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入法人身份证号" v-decorator="['compzd1Cardno', {rules: [{required: true, message: '请输入法人身份证号！'}]}]" />
        </a-form-item>
        <a-form-item
          label="站点id"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入站点id" v-decorator="['stationId', {rules: [{required: true, message: '请输入站点id！'}]}]" />
        </a-form-item>
        <a-form-item
          label="所属平台id"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入所属平台id" v-decorator="['platformId', {rules: [{required: true, message: '请输入所属平台id！'}]}]" />
        </a-form-item>
        <a-form-item
          label="商家类型，汽配商或厂家"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入商家类型，汽配商或厂家" v-decorator="['companyType', {rules: [{required: true, message: '请输入商家类型，汽配商或厂家！'}]}]" />
        </a-form-item>
        <a-form-item
          label="税率"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入税率" v-decorator="['taxrate', {rules: [{required: true, message: '请输入税率！'}]}]" />
        </a-form-item>
        <a-form-item
          label="法人姓名（银行信息）"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入法人姓名（银行信息）" v-decorator="['bankLegalName', {rules: [{required: true, message: '请输入法人姓名（银行信息）！'}]}]" />
        </a-form-item>
        <a-form-item
          label="统一社会信用代码"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入统一社会信用代码" v-decorator="['unifiedSocialCreditCode', {rules: [{required: true, message: '请输入统一社会信用代码！'}]}]" />
        </a-form-item>
        <a-form-item
          label="管理员账号"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入管理员账号" v-decorator="['userAccount', {rules: [{required: true, message: '请输入管理员账号！'}]}]" />
        </a-form-item>
        <a-form-item
          label="优先级"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入优先级" v-decorator="['priority', {rules: [{required: true, message: '请输入优先级！'}]}]" />
        </a-form-item>
        <a-form-item
          label="公司简称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入公司简称" v-decorator="['shortName', {rules: [{required: true, message: '请输入公司简称！'}]}]" />
        </a-form-item>
        <a-form-item
          label="供应商名称首字母拼音"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入供应商名称首字母拼音" v-decorator="['firstLetter', {rules: [{required: true, message: '请输入供应商名称首字母拼音！'}]}]" />
        </a-form-item>
        <a-form-item
          label="供应商名称拼音全拼"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入供应商名称拼音全拼" v-decorator="['fullLetter', {rules: [{required: true, message: '请输入供应商名称拼音全拼！'}]}]" />
        </a-form-item>
        <a-form-item
          label="公司im开通状态"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入公司im开通状态" v-decorator="['imStatus', {rules: [{required: true, message: '请输入公司im开通状态 开通  禁用！'}]}]" />
        </a-form-item>
        <a-form-item
          label="ERP供应商编码"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入ERP供应商编码" v-decorator="['erpCompanyCode', {rules: [{required: true, message: '请输入ERP供应商编码！'}]}]" />
        </a-form-item>
        <a-form-item
          label="审核状态"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <!-- <a-input placeholder="请输入审核状态，0，未审核，10，审核中，20，已审核  40 计划停用" v-decorator="['state', {rules: [{required: true, message: '请输入审核状态，0，未审核，10，审核中，20，已审核  40 计划停用！'}]}]" /> -->
          <a-radio-group v-decorator="['state', {rules: [{required: true, message: '请输入审核状态'}]}]">
            <a-radio :value="0">
              未审核
            </a-radio>
            <a-radio :value="10">
              审核中
            </a-radio>
            <a-radio :value="20">
              已审核
            </a-radio>
            <a-radio :value="30">
              已审核1
            </a-radio>
            <a-radio :value="40">
              计划停用
            </a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item
          label="一般纳税人资格证url"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入一般纳税人资格证url" v-decorator="['qualificationUrl', {rules: [{required: true, message: '请输入一般纳税人资格证url！'}]}]" />
        </a-form-item>
        <a-form-item
          label="审核时间"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-date-picker style="width: 100%" placeholder="请选择审核时间" v-decorator="['verifyTime',{rules: [{ required: true, message: '请选择审核时间！' }]}]" @change="verifyTimeOnChange"/>
        </a-form-item>
        <a-form-item
          label="产品经营授权书(多张"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入产品经营授权书(多张" v-decorator="['productLicensing', {rules: [{required: true, message: '请输入产品经营授权书(多张！'}]}]" />
        </a-form-item>
        <a-form-item
          label="经营类目"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入经营类目" v-decorator="['businessCategory', {rules: [{required: true, message: '请输入经营类目！'}]}]" />
        </a-form-item>
        <a-form-item
          label="身份证正面"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <img alt="请输入营业执照电子版" style="width: 50%" :src="result.frontCardUrl" />
        </a-form-item>
        <a-form-item
          label="身份证反面"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <img alt="请输入营业执照电子版" style="width: 50%" :src="result.backCardUrl" />
        </a-form-item>
        <a-form-item
          label="所属大区id"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入所属大区id" v-decorator="['regionId', {rules: [{required: true, message: '请输入所属大区id！'}]}]" />
        </a-form-item>
        <a-form-item
          label="首单弹窗提示，1首单弹窗提示，2,100单，3,500单，4,1000单"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入首单弹窗提示，1首单弹窗提示，2,100单，3,500单，4,1000单" v-decorator="['popUpStatus', {rules: [{required: true, message: '请输入首单弹窗提示，1首单弹窗提示，2,100单，3,500单，4,1000单！'}]}]" />
        </a-form-item>
        <a-form-item
          label="销售所属大区集合"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入销售所属大区集合" v-decorator="['saleRegionIds', {rules: [{required: true, message: '请输入销售所属大区集合！'}]}]" />
        </a-form-item>
        <a-form-item
          label="银行开户许可证"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入银行开户许可证" v-decorator="['openingAccountUrl', {rules: [{required: true, message: '请输入银行开户许可证！'}]}]" />
          <img alt="请输入银行开户许可证" style="width: 50%" :src="result.openingAccountUrl" />
        </a-form-item>
        <a-form-item
          label="增值税专用发票样版"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <img alt="增值税专用发票样版" style="width: 50%" :src="result.invoiceTemplateUrl" />
        </a-form-item>
        <a-form-item
          label="门店照片(多张)"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <img alt="门店照片" style="width: 50%" :src="result.storePhotoUrl" />
        </a-form-item>
        <a-form-item
          label="仓储合同复印件或仓储发票(多张)"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <img alt="仓储合同复印件或仓储发票" style="width: 50%" :src="result.warehousContractUrl" />
        </a-form-item>
        <a-form-item
          label="供应商商品销售价是否显示：1.显示，2不显示"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入供应商商品销售价是否显示：1.显示，2不显示" v-decorator="['goodsStatus', {rules: [{required: true, message: '请输入供应商商品销售价是否显示：1.显示，2不显示！'}]}]" />
        </a-form-item>
        <a-form-item
          label="合同开始时间"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入合同开始时间" v-decorator="['contractStartTime', {rules: [{required: true, message: '请输入合同开始时间！'}]}]" />
        </a-form-item>
        <a-form-item
          label="合同结束时间"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入合同结束时间" v-decorator="['contractEndTime', {rules: [{required: true, message: '请输入合同结束时间！'}]}]" />
        </a-form-item>
        <a-form-item
          label="保证金"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入保证金" v-decorator="['bond', {rules: [{required: true, message: '请输入保证金！'}]}]" />
        </a-form-item>
        <a-form-item
          label="业务分类（售前供应商，售后供应商，非车供应商，C端供应商）"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入业务分类（售前供应商，售后供应商，非车供应商，C端供应商）" v-decorator="['transactionType', {rules: [{required: true, message: '请输入业务分类（售前供应商，售后供应商，非车供应商，C端供应商）！'}]}]" />
        </a-form-item>
        <a-form-item
          label="业务分类描述"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入业务分类描述" v-decorator="['transactionTypeDescription', {rules: [{required: true, message: '请输入业务分类描述！'}]}]" />
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>

<script>
  import moment from 'moment'
  import { wmsCompanyEdit, wmsCompanyDetail } from '@/api/modular/main/wmscompany/wmsCompanyManage'
  export default {
    data () {
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 15 }
        },
        result: {},
        businessLicensePhotoString: '',
        createdateDateString: '',
        storeEndDateDateString: '',
        businessLicenseStartDateDateString: '',
        businessLicenseEndDateDateString: '',
        verifyTimeDateString: '',
        visible: false,
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      moment,
      // 初始化方法
      edit (record) {
        this.visible = true
        setTimeout(() => {
          var parameter = {
            'compid': record.compid
          }
          wmsCompanyDetail(parameter).then((res) => {
            if (res.success) {
              record = res.data
              this.businessLicensePhotoString = record.businessLicensePhoto
              this.result = res.data
              this.form.setFieldsValue(
                {
                  compid: record.compid,
                  compname: record.compname,
                  areaId: record.areaId,
                  areaName: record.areaName,
                  tmsCustomerId: record.tmsCustomerId,
                  comptype: record.comptype,
                  address: record.address,
                  mobile: record.mobile,
                  relation: record.relation,
                  pym: record.pym,
                  wbm: record.wbm,
                  businesslicenseno: record.businesslicenseno,
                  companystaffnum: record.companystaffnum,
                  registeredcapital: record.registeredcapital,
                  companytel: record.companytel,
                  apsId: record.apsId,
                  storeId: record.storeId,
                  memberId: record.memberId,
                  storeName: record.storeName,
                  employeeId: record.employeeId,
                  cityId: record.cityId,
                  provinceId: record.provinceId,
                  qrCodeContent: record.qrCodeContent,
                  qrCodeAttchId: record.qrCodeAttchId,
                  motorcycle: record.motorcycle,
                  brand: record.brand,
                  storeType: record.storeType,
                  storeBzfw: record.storeBzfw,
                  storeBzj: record.storeBzj,
                  sotreBzjMoney: record.sotreBzjMoney,
                  storeZhengpin: record.storeZhengpin,
                  storeShiti: record.storeShiti,
                  storeQitian: record.storeQitian,
                  storeTuihuan: record.storeTuihuan,
                  storeShiyong: record.storeShiyong,
                  storeErxiaoshi: record.storeErxiaoshi,
                  storeHuodao: record.storeHuodao,
                  storeXiaofeibaozhang: record.storeXiaofeibaozhang,
                  sotreYouxiangdai: record.sotreYouxiangdai,
                  companyName: record.companyName,
                  companyProvinceId: record.companyProvinceId,
                  companyAddress: record.companyAddress,
                  companyPhone: record.companyPhone,
                  companyEmployeeCount: record.companyEmployeeCount,
                  companyRegisteredCapital: record.companyRegisteredCapital,
                  companyContactsName: record.companyContactsName,
                  companyContactsTel: record.companyContactsTel,
                  companyContactsEamil: record.companyContactsEamil,
                  businessLicenseAddress: record.businessLicenseAddress,
                  businessLicenseRange: record.businessLicenseRange,
                  businessLicensePhoto: record.businessLicensePhoto,
                  organizationCode: record.organizationCode,
                  organizationCodePhoto: record.organizationCodePhoto,
                  generalTaxpayer: record.generalTaxpayer,
                  bankAccountName: record.bankAccountName,
                  bankAccountNumber: record.bankAccountNumber,
                  bankName: record.bankName,
                  bankCodeName: record.bankCodeName,
                  bankCode: record.bankCode,
                  bankAddress: record.bankAddress,
                  bankLicenceElectronic: record.bankLicenceElectronic,
                  settlementBankAccountName: record.settlementBankAccountName,
                  settlementBankAccountNumber: record.settlementBankAccountNumber,
                  settlementBankName: record.settlementBankName,
                  settlementBankCode: record.settlementBankCode,
                  settlementBankAddress: record.settlementBankAddress,
                  taxRegistrationCertificate: record.taxRegistrationCertificate,
                  taxpayerId: record.taxpayerId,
                  taxRegistrationCertificatePhoto: record.taxRegistrationCertificatePhoto,
                  createPerson: record.createPerson,
                  updatePerson: record.updatePerson,
                  companyStatus: record.companyStatus,
                  erpCompanyId: record.erpCompanyId,
                  deleted: record.deleted,
                  mainGoods: record.mainGoods,
                  companyTitlePhoto: record.companyTitlePhoto,
                  gg9: record.gg9,
                  fromDgj: record.fromDgj,
                  inviteIdDgj: record.inviteIdDgj,
                  position: record.position,
                  areaid: record.areaid,
                  standardFee: record.standardFee,
                  workingtime: record.workingtime,
                  storeLogo: record.storeLogo,
                  storename: record.storename,
                  compzd1Cardno: record.compzd1Cardno,
                  linkData: record.linkData,
                  stationId: record.stationId,
                  platformId: record.platformId,
                  companyType: record.companyType,
                  shippingProvider: record.shippingProvider,
                  shippingType: record.shippingType,
                  timeNode: record.timeNode,
                  shippingXianshida: record.shippingXianshida,
                  xianshidaTimeAging: record.xianshidaTimeAging,
                  xianshidaFeePerson: record.xianshidaFeePerson,
                  xianshidaTimeNode: record.xianshidaTimeNode,
                  dispatchDescription1: record.dispatchDescription1,
                  dispatchDescription2: record.dispatchDescription2,
                  bandpic: record.bandpic,
                  goodsTempSize: record.goodsTempSize,
                  serviceBrand: record.serviceBrand,
                  serviceWearBrand: record.serviceWearBrand,
                  serviceWearArea: record.serviceWearArea,
                  serviceArea: record.serviceArea,
                  img: record.img,
                  taxrate: record.taxrate,
                  storeBanner: record.storeBanner,
                  ufcAccountId: record.ufcAccountId,
                  ufcAccountPassword: record.ufcAccountPassword,
                  wxtUser: record.wxtUser,
                  wxtOpenId: record.wxtOpenId,
                  companyHeadId: record.companyHeadId,
                  companyHeadName: record.companyHeadName,
                  companyHeadRelation: record.companyHeadRelation,
                  signSms: record.signSms,
                  qq: record.qq,
                  erpType: record.erpType,
                  bankLegalName: record.bankLegalName,
                  bankLegalId: record.bankLegalId,
                  back: record.back,
                  memberStatus: record.memberStatus,
                  memberStartTime: record.memberStartTime,
                  memberEndTime: record.memberEndTime,
                  legalPersonMobile: record.legalPersonMobile,
                  unifiedSocialCreditCode: record.unifiedSocialCreditCode,
                  userAccount: record.userAccount,
                  pwd2: record.pwd2,
                  businessModel: record.businessModel,
                  priority: record.priority,
                  shortName: record.shortName,
                  firstLetter: record.firstLetter,
                  fullLetter: record.fullLetter,
                  platformIds: record.platformIds,
                  platformIdsS: record.platformIdsS,
                  commissionSetting: record.commissionSetting,
                  settlementState: record.settlementState,
                  printConfig: record.printConfig,
                  isSynErp: record.isSynErp,
                  issynerp: record.issynerp,
                  thirdFreightPayer: record.thirdFreightPayer,
                  imStatus: record.imStatus,
                  imstatus: record.imstatus,
                  erpCustomerCode: record.erpCustomerCode,
                  erpCompanyCode: record.erpCompanyCode,
                  state: record.state,
                  qualificationUrl: record.qualificationUrl,
                  productLicensing: record.productLicensing,
                  businessCategory: record.businessCategory,
                  frontCardUrl: record.frontCardUrl,
                  backCardUrl: record.backCardUrl,
                  otherBrand: record.otherBrand,
                  compEmail: record.compEmail,
                  applyOpinion: record.applyOpinion,
                  compContract: record.compContract,
                  compType: record.compType,
                  compAgreement: record.compAgreement,
                  fax: record.fax,
                  regionId: record.regionId,
                  isBarterEnquiry: record.isBarterEnquiry,
                  quoteTips: record.quoteTips,
                  popUpStatus: record.popUpStatus,
                  saleRegionIds: record.saleRegionIds,
                  openingAccountUrl: record.openingAccountUrl,
                  invoiceTemplateUrl: record.invoiceTemplateUrl,
                  trademarkRegisterUrl: record.trademarkRegisterUrl,
                  productionLicenceUrl: record.productionLicenceUrl,
                  productionStandardUrl: record.productionStandardUrl,
                  qualityReportUrl: record.qualityReportUrl,
                  inventoryPhotoUrl: record.inventoryPhotoUrl,
                  storePhotoUrl: record.storePhotoUrl,
                  warehousContractUrl: record.warehousContractUrl,
                  goodsStatus: record.goodsStatus,
                  contractStartTime: record.contractStartTime,
                  contractEndTime: record.contractEndTime,
                  bond: record.bond,
                  transactionType: record.transactionType,
                  transactionTypeDescription: record.transactionTypeDescription
                }
              )
            } else {
              this.$message.error('获取数据失败')//  + res.message
            }
          })
        }, 100)
        // 时间单独处理
        if (record.createdate) {
            this.form.getFieldDecorator('createdate', { initialValue: moment(record.createdate, 'YYYY-MM-DD') })
            this.createdateDateString = moment(record.createdate).format('YYYY-MM-DD')
        }
        // 时间单独处理
        if (record.storeEndDate) {
            this.form.getFieldDecorator('storeEndDate', { initialValue: moment(record.storeEndDate, 'YYYY-MM-DD') })
            this.storeEndDateDateString = moment(record.storeEndDate).format('YYYY-MM-DD')
        }
        // 时间单独处理
        if (record.businessLicenseStartDate) {
            this.form.getFieldDecorator('businessLicenseStartDate', { initialValue: moment(record.businessLicenseStartDate, 'YYYY-MM-DD') })
            this.businessLicenseStartDateDateString = moment(record.businessLicenseStartDate).format('YYYY-MM-DD')
        }
        // 时间单独处理
        if (record.businessLicenseEndDate) {
            this.form.getFieldDecorator('businessLicenseEndDate', { initialValue: moment(record.businessLicenseEndDate, 'YYYY-MM-DD') })
            this.businessLicenseEndDateDateString = moment(record.businessLicenseEndDate).format('YYYY-MM-DD')
        }
        // 时间单独处理
        if (record.verifyTime) {
            this.form.getFieldDecorator('verifyTime', { initialValue: moment(record.verifyTime, 'YYYY-MM-DD') })
            this.verifyTimeDateString = moment(record.verifyTime).format('YYYY-MM-DD')
        }
      },
      handleSubmit () {
        const { form: { validateFields } } = this
        this.confirmLoading = true
        validateFields((errors, values) => {
          if (!errors) {
            for (const key in values) {
              if (typeof (values[key]) === 'object' && values[key] != null) {
                values[key] = JSON.stringify(values[key])
              }
            }
            values.createdate = this.createdateDateString || null
            values.storeEndDate = this.storeEndDateDateString || null
            values.businessLicenseStartDate = this.businessLicenseStartDateDateString || null
            values.businessLicenseEndDate = this.businessLicenseEndDateDateString || null
            values.verifyTime = this.verifyTimeDateString || null
            wmsCompanyEdit(values).then((res) => {
              if (res.success) {
                this.$message.success('编辑成功')
                this.confirmLoading = false
                this.$emit('ok', values)
                this.handleCancel()
              } else {
                this.$message.error('编辑失败')//  + res.message
              }
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
            this.confirmLoading = false
          }
        })
      },
      createdateOnChange(date, dateString) {
        this.createdateDateString = dateString
      },
      storeEndDateOnChange(date, dateString) {
        this.storeEndDateDateString = dateString
      },
      businessLicenseStartDateOnChange(date, dateString) {
        this.businessLicenseStartDateDateString = dateString
      },
      businessLicenseEndDateOnChange(date, dateString) {
        this.businessLicenseEndDateDateString = dateString
      },
      verifyTimeOnChange(date, dateString) {
        this.verifyTimeDateString = dateString
      },
      handleCancel () {
        this.createdateDateString = ''
        this.form.getFieldDecorator('createdate', { initialValue: null })
        this.storeEndDateDateString = ''
        this.form.getFieldDecorator('storeEndDate', { initialValue: null })
        this.businessLicenseStartDateDateString = ''
        this.form.getFieldDecorator('businessLicenseStartDate', { initialValue: null })
        this.businessLicenseEndDateDateString = ''
        this.form.getFieldDecorator('businessLicenseEndDate', { initialValue: null })
        this.verifyTimeDateString = ''
        this.form.getFieldDecorator('verifyTime', { initialValue: null })
        this.form.resetFields()
        this.visible = false
      }
    }
  }
</script>
